Learning Objectives

After completing this lesson, you'll be able to:

Instructions

In this lesson, you will:

Resources

Exercise

Jennifer

Jennifer's workspace can now detect when an upload's schema has drifted, but it only reports this in the FME log. She wants whoever uploaded the file to receive a readable report, whether the check passed or failed, so they can correct their own data before it reaches the base dataset.

In this exercise, you will:

1) Message the Unexpected Attributes

The ChangeDetector's Inserted port carries attributes that appear in the upload but not in the original. Each one needs a sentence a person can act on.

AttributeCreator parameters

2) Message the Missing Attributes

The Deleted port is the mirror image: attributes the original had and the upload does not. The message wording is what tells the uploader which direction the problem runs in.

AttributeCreator_2 parameters

3) Detect a Clean Schema

No messages means no drift, and that case needs its own branch. The NoFeaturesTester fires only when nothing reaches it, which is exactly the signal for a passing check.

NoFeaturesTester workflow

4) Build the Failure Report

This is the report an uploader sees when the check fails, so it needs to say what went wrong and list the offending attributes rather than just reporting a failure.

Changing first HTML section to a Header

Adding a header

Plus button to add an HTML section

HTMLReportGenerator Table parameters

Final Page Contents in the HTMLReportGenerator parameters

5) Lay Out the Failure Report

The report generator produces the content; the layouter arranges it. Pairing the two is the usual way to get a tidy Bootstrap or vertical layout without hand-writing HTML.

Added HTMLLayouter

6) Build the Success Report

A passing check deserves an answer too. Without it the uploader cannot tell success from a workspace that simply did not run.

HTMLReportGenerator_2 parameters

HTMLReporter_2 and HTMLLayouter_2 added to workspace

7) Add the HTML Writers

Two outcomes need two output files. Writing them to the same folder keeps the pair together for whoever collects the report.

HTML Writer parameters

8) Run the Workspace

The upload in this exercise has drifted, so the failure branch is the one that fires. Opening the file is how you see what the uploader would receive.

Inspect HTML output

Schema Change Report example

You have turned a schema comparison into something a person can act on: a report that names exactly which attributes are missing or unexpected, and a matching report for when nothing has drifted. The same output could be emailed from an Automation, or returned in the browser from an FME Flow App so an uploader sees it the moment they submit a file.

 

Tips

 

Additional Resources